package com.chixing.ih.module.system.mapper.provider;

import com.chixing.ih.module.system.pojo.User;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author 刘岩
 * @version 1.0
 * @Desc Practice makes perfect
 * @date 2020/9/21 22:29
 */


public class UserMapperProvider  {

    public String insertOne() {
        return new SQL() {{
            INSERT_INTO("tbl_user");
            VALUES("user_account", "#{userAccount}");
            VALUES("nick_name", "#{nickName}");
            VALUES("user_password", "#{userPassword}");
            VALUES("user_email", "#{userEmail}");
            VALUES("role_id", "#{roleId}");
            VALUES("update_time", "#{updateTime}");
        }}.toString();

    }

    public String insertOneById() {
        return new SQL() {{
            INSERT_INTO("tbl_user");
            VALUES("user_telephone", "#{userTelephone}");
            VALUES("user_introduction", "#{userIntroduction}");
            VALUES("user_status", "#{userStatus}");
            VALUES("user_career", "#{userCareer}");
            VALUES("user_email", "#{userEmail}");
            VALUES("user_career_direct", "#{userCareerDirect}");
            VALUES("user_position", "#{userPosition}");
            VALUES("user_company", "#{ userCompany}");
            WHERE("user_id = #{userId}");
        }}.toString();
    }

    public String getOneByAccount() {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_user");
            WHERE("user_account = #{userAccount}");
        }}.toString();
    }


    public String getOneByNickName() {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_user");
            WHERE("nick_name = #{nickName}");
        }}.toString();
    }

    public String getOne(User user) {
        return new SQL() {{
            SELECT("*");
            FROM("tbl_user");
            WHERE("user_account = #{userAccount} AND user_password=#{userPassword} AND is_deleted=0");
        }}.toString();
    }



    public String deleteOneById() {
        return null;
    }


    public String getOneById() {
        return null;
    }


    public String listAll() {
        return null;
    }


    public String updateOne(User user) {
        return null;
    }



    public String deleteAll() {
        return null;
    }
}
